/**
 * 店铺相关API
 */

const request = require('../utils/request');

/**
 * 获取店铺信息
 * @returns {Promise} 返回Promise对象
 */
const getShopInfo = () => {
  return request.get('/shop/info');
};

/**
 * 创建店铺
 * @param {Object} shopData - 店铺数据
 * @returns {Promise} 返回Promise对象
 */
const createShop = (shopData) => {
  return request.post('/shop/create', shopData);
};

/**
 * 更新店铺信息
 * @param {Object} shopData - 店铺数据
 * @returns {Promise} 返回Promise对象
 */
const updateShop = (shopData) => {
  return request.put('/shop/update', shopData);
};

/**
 * 更新店铺状态
 * @param {string} status - 店铺状态 'open'|'rest'|'closed'
 * @returns {Promise} 返回Promise对象
 */
const updateStatus = (status) => {
  return request.put('/shop/status', { status });
};

/**
 * 更新店铺位置
 * @param {Object} location - 位置信息
 * @returns {Promise} 返回Promise对象
 */
const updateLocation = (location) => {
  return request.put('/shop/location', location);
};

/**
 * 获取店铺统计数据
 * @returns {Promise} 返回Promise对象
 */
const getStatistics = () => {
  return request.get('/shop/statistics');
};

module.exports = {
  getShopInfo,
  createShop,
  updateShop,
  updateStatus,
  updateLocation,
  getStatistics
};